package cn.neusoft.luofa603.yuejian.Activity;

import android.databinding.DataBindingUtil;
import android.databinding.ViewDataBinding;
import android.support.annotation.MenuRes;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

import cn.neusoft.luofa603.yuejian.R;
import cn.neusoft.luofa603.yuejian.databinding.ToolbarBinding;

public abstract class ToolbarActivity<B extends ViewDataBinding> extends BaseActivity<B> {
    protected ToolbarBinding toolbarBinding;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        toolbarBinding = DataBindingUtil.findBinding(findViewById(R.id.topBar));
    }

    public void setToolbarTitle(String title){
        toolbarBinding.setTitle(title);
    }

    public void setToolbarMenu(@MenuRes int menuId){
        toolbarBinding.toolbar.inflateMenu(menuId);
    }
}

